<script setup>
    import { useRouter } from "vue-router";
defineProps({
couretitle:{
    type:String
},
item:{
    type:Array
},
Course:{
    type:Object
},
cid:{
    type:Number
}
    })
const router=useRouter()
const JumpDetail=(id)=>{
    router.push({path:'/detail',query:{id}})
    
}
const emits=defineEmits(['JumpList'])    
const JumpList=()=>{
    //     console.log(cid);
    // router.push({path:'/publiclist',query:{id:cid}})
    emits('JumpList')

}
</script>
<template>
    <div>
        <div class="_box_item">
            <div class="_box_head">
                <h3>{{couretitle}}</h3>
                <div class="_box_color" @click="JumpList()">查看全部</div>
            </div>
            <!-- {{Course.course_list}} -->
            <div class="_box_main" >
                    <div class="_box_main_item" v-for="val in item" :key="val.id" @click="JumpDetail(val.id)">
                        <img :src="val.teacher[0].avatar" alt="">
                        <p class="_box_main_detail">{{val.title}}</p>
                        <div class="_box_main_price">{{val.member_price==0?'免费':val.member_price}}</div>
                        <p class="_box_main_text_color">{{val.sales_num}}人已报名</p>
                    </div>
            </div>
        </div>
    </div>
</template>
<style scoped>
._box_item{
    width: 100%;
    height: 470px;
    padding: 30px;
    box-sizing: border-box;
    background-color: white;
    margin-top: 20px;
}
._box_head{
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* background-color: aqua; */
}
._box_main{
    width: 100%;
    height: 75%;
    /* background-color: aquamarine; */
    margin-top: 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
._box_main_item{
    width: 32%;
    height: 90%;
    background-color: #eaeaea;
    /* position: absolute;
    bottom: 0; */
    font-size: 26px;
    padding: 15px;
    box-sizing: border-box;
    text-align: center;
    position: relative;
}
._box_main_item img{
    width: 90px;
    height: 90px;
    border-radius: 50%;
    position: absolute;
    top: -50px;
    left: 30%;
}
._box_main_price{
    height: 35px;
    font-size: 24px;
    text-align: center;
    background-color: 80%;
    margin: auto;
    border-radius: 15px;
    background-color: #f15a24;
    line-height: 35px;
    color: #fff;
}
._box_main_text_color{
    color: #f15a24;
}
._box_color{
    color: grey;
    font-size: 26px;
}
._box_main_detail{
    height:  45%;
}
</style>